<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue模块语法 v-bind指令</title>
    <style>
        /* 预先设定的背景颜色和文字颜色 */
        .class1 {
            background: #666;
            color: #eee;
        }
    </style>
</head>
<body>
    <!-- v-bind指令主要修改html的css属性 -->
    <div id="app">
        <label for="">修改背景颜色</label><input type="checkbox" name="" id="r1" v-model="use">
        <br><br>
        <div v-bind:class="{'class1': use}">
            v-bind:class指令
        </div>
    </div>
</body>
<script src="vue.js"></script>
<script>
    new Vue({
        el: "#app",
        data: {
            use: false
        }
    })
</script>
</html>